#!/bin/sh

. libtest.sh

export COLUMNS=100

tigrc <<EOF
bind generic a !?@user-test-cmd
bind generic b ?@user-test-cmd
bind generic c !?user-test-cmd
bind generic d !user-test-cmd
bind generic ca !?@git commit --amend --no-edit
source $base_dir/../contrib/vim.tigrc
EOF

steps '
	:view-help
	/user-test-cmd<Enter>
	?toggle author<Enter>
	:save-display default.screen
'

stdin <<EOF
test
EOF

test_tig

assert_equals 'default.screen' <<EOF
                             oa :toggle author
                             og :toggle line-graphics
                             of :toggle file-name
                             op :toggle ignore-space
                             oi :toggle id
                             ot :toggle commit-title-overflow
                             oF :toggle file-filter
                             or :toggle commit-title-refs
                             @- :toggle diff-context -1
                             @+ :toggle diff-context +1
Internal commands:
                             @j :/^@@
                             @k :?^@@
External commands:
                              a @?user-test-cmd
                              b @?user-test-cmd
                              d !user-test-cmd
                             cc !git commit
                             ca @?git commit --amend --no-edit
[-] search bindings
View manipulation
                       <Ctrl-C> view-close          Close the current view
Searching
     <Down>, <Ctrl-N>, <Ctrl-J> find-next           Find next search match
       <Up>, <Ctrl-P>, <Ctrl-K> find-prev           Find previous search match
[-] main bindings
Cursor navigation
                              G move-last-line      Move cursor to last line
[help] - line 81 of 155                                                                          69%
EOF
